<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
   .parent{
    width: 900px;
    height: 600px;
    background-color: #ccc;
    display: flex;
    flex-wrap: wrap;
   }
   .parent>div{
    width: 300px;
    height: 300px;
   }
    </style>
</head>
<body>
<div class="parent">
    <div class="div1" style="background-color: red;">
        <div>子代1</div>
        <div style="width: 150px;height: 150px;background-color: blue;"  >子代2</div>
    </div>
    <div class="div2" style="background-color: green;">弹性元素2</div>
    <div class="div3" style="background-color: blue;">弹性元素3</div>
    <div class="div1" style="background-color: red;">弹性元素1</div>
    <div class="div2" style="background-color: green;">弹性元素2</div>
    <div class="div3" style="background-color: blue;">弹性元素3</div>
</div>
</body>
</html>